﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcStarterKit.Core.Entities;
using MvcStarterKit.Core.Interfaces;

namespace MvcStarterKit.UI.Controllers
{
	[HandleError]
	public class HomeController : Controller
	{
		private IProductRepository productRepository;

		public HomeController()
		{
			
		}

		public HomeController(IProductRepository repository)
		{
			productRepository = repository;
		}

		public ActionResult Index()
		{
			ViewData["Message"] = "Welcome to ASP.NET MVC!";
			ViewData["totalProduct"] = productRepository.GetAll().Count;

			return View();
		}

		public ActionResult About()
		{
			return View();
		}
	}
}
